home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
PowerLisp 2.01
/
PowerLisp 2.01 ƒ
/
Library
/
defpackage.lisp
< prev
next >
Wrap
Lisp/Scheme
|
1996-05-17
|
1KB
|
41 lines
;;;
;;; PowerLisp 2.0
;;; Copyright © 1996 Roger Corman. All rights reserved.
;;;
;
; File: defpackage.lisp
; Contents: defpackage implementation for PowerLisp.
;
(in-package :common-lisp)
(provide :defpackage)
(defmacro defpackage (name &rest options)
`(eval-when (:load-toplevel :compile-toplevel :execute)
(let ((package (find-package ',name)))
(if (null package)
(setq package (make-package ',name)))
(dolist (opt ',options)
(if (not (consp opt))
(error "Invalid defpackage option--should be a list: ~A~%"
opt))
(ecase (car opt)
(:size nil) ;; ignore this for now
(:nicknames (rename-package ',name ',name (cdr opt)))
(:shadow (shadow (cdr opt) ',name))
(:shadowing-import-from (shadowing-import (cdr opt) ',name))
(:use (use-package (cdr opt) ',name))
(:import-from (import (cdr opt) ',name))
(:intern (dolist (sym (cdr opt))
(intern sym ',name)))
(:export (export (cdr opt) ',name))))
package)))